package com.easygo.service.impl;

import com.easygo.mapper.BrandMapper;
import com.easygo.pojo.Brand;
import com.easygo.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @BelongsProject: easygo
 * @BelongsPackage: com.easygo.service.impl
 * @Author: wangzhen
 * @QQ:425042686
 * @CreateTime: 2024-03-27 11:01
 * @Description: TODO
 */
@Service
public class BrandServiceImpl implements BrandService {

    // 注入BrandMapper
    @Resource
    BrandMapper brandMapper;

    // 获取所有品牌
    @Override
    public List<Brand> getBrands() {
        return brandMapper.getBrands();
    }

    // 添加品牌
    @Override
    public int addBrand(Brand brand) {
        return brandMapper.addBrand(brand);
    }

    // 更新品牌
    @Override
    public int updateBrand(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    // 根据id获取品牌
    @Override
    public Brand getBrandById(Integer id) {
        return brandMapper.getBrandById(id);
    }

    // 根据id删除品牌
    @Override
    public int deleteBrand(Integer id) {
        return brandMapper.deleteBrand(id);
    }

    // 根据ids删除品牌
    @Override
    public int deleteSome(String ids) {
        return brandMapper.deleteSome(ids);
    }
}
